﻿<Window x:Class="Hammer_store.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Hammer_store"
        xmlns:cef="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
        mc:Ignorable="d"
        Height="450" 
        Width="800" 
        ResizeMode="CanResizeWithGrip" 
        WindowStartupLocation="CenterScreen"
        WindowStyle="None"
        AllowsTransparency="True"
        Background="Transparent"
        Icon="Resources/Images/logo2.png"
        Title="Hammer store">

    <!--** Рамка с градиентом **-->
    <Border CornerRadius="5" BorderThickness="5">
        <Border.BorderBrush>
            <LinearGradientBrush StartPoint="0 0" EndPoint="1 1">
                <GradientStop Color="#FF661579" Offset="0.0"/>
                <GradientStop Color="#282c36" Offset="0.5"/>
                <GradientStop Color="#FF661579" Offset="1.0"/>
            </LinearGradientBrush>
        </Border.BorderBrush>
           
        <!--** Сетка для элементов **-->
        <Grid>

            <!--* Разметка для сетки *-->
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition />
            </Grid.RowDefinitions>

            <!--* Фон для сетки *-->
            <Grid.Background>
                <LinearGradientBrush StartPoint="0 0" EndPoint="1 1">
                    <GradientStop Color="#FF661579" Offset="0.0"/>
                    <GradientStop Color="#282c36" Offset="0.5"/>
                    <GradientStop Color="#FF661579" Offset="1.0"/>
                </LinearGradientBrush>
            </Grid.Background>

            <!--* ТайтлБар для опций с окном *-->
            <Grid Name="TitleBar"
                  MouseDown="TitleBar_MouseDown"
                  Background="Transparent"
                  Grid.Row="0">

                <!--Изображение для закрытия формы-->
                <Image x:Name="Image_cross"
                       Width="35"
                       Height="35"
                       HorizontalAlignment="Right"
                       Margin="0 0 0 0"
                       MouseDown="Image_cross_MouseDown">
                    
                    <Image.Effect>
                        <DropShadowEffect Direction="270" BlurRadius="10"/>
                    </Image.Effect>

                    <Image.Style>
                        <Style TargetType="{x:Type Image}">
                            <Setter Property="Source" 
                                    Value="Resources/Images/cross_NotActivate.png"/>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsMouseOver, ElementName=Image_cross}" 
                                             Value="True">
                                    <Setter Property="Source" 
                                            Value="Resources/Images/cross_Activate.png"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Image.Style>

                </Image>
                
                <!--Изображение для перевода окна в полноэкранный режим-->
                <Image x:Name="Image_maximize"
                       Width="25"
                       Height="25"
                       HorizontalAlignment="Right"
                       Margin="0 0 40 0"
                       MouseDown="Image_maximize_MouseDown">
                    
                    <Image.Effect>
                        <DropShadowEffect Direction="270" BlurRadius="10"/>
                    </Image.Effect>

                    <Image.Style>
                        <Style TargetType="{x:Type Image}">
                            <Setter Property="Source"
                                    Value="Resources/Images/maximizeOne.png"/>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsMouseOver, ElementName=Image_maximize}"
                                             Value="True">
                                    <Setter Property="Source"
                                            Value="Resources/Images/maximizeTwo.png"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Image.Style>
                    
                </Image>

                <!--Изображение для сворачивания формы-->
                <Image x:Name="Image_colapso"
                       Width="25"
                       Height="25"
                       HorizontalAlignment="Right"
                       Margin="0 0 75 0"
                       MouseDown="Image_colapso_MouseDown">
                    
                    <Image.Effect>
                        <DropShadowEffect Direction="270" BlurRadius="10"/>
                    </Image.Effect>

                    <!--Триггер для отображения другой картинки-->
                    <Image.Style>
                        <Style TargetType="{x:Type Image}">
                            <Setter Property="Source" 
                                    Value="Resources/Images/colapsoOne.png"/>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsMouseOver, ElementName=Image_colapso}"
                                             Value="True">
                                    <Setter Property="Source" 
                                            Value="Resources/Images/colapsoTwo.png"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Image.Style>

                </Image>

            </Grid>
            
            <!--* Браузер *-->
            <Grid Name="Site_Hammer_store"
                  Grid.Row="1">
                
                <cef:ChromiumWebBrowser
                    x:Name="Browser"
                    Address="https://store.steampowered.com/"/>
                
            </Grid>

        </Grid>
    </Border>
</Window>
